package serverside;

import java.sql.SQLException;
import java.util.Scanner;
import javax.swing.JOptionPane;

public class BalanceInquiry extends Transaction {

    private Scanner input;

    public BalanceInquiry(int _cardID, DatabasePack.BankDatabase atmBankDatabase, Screen atmScreen) {
        super(_cardID, atmBankDatabase, atmScreen);
        input = new Scanner(System.in);
    }

    @Override
    public void execute() {
        System.out.println("Transaction::BalanceInquiry");
        DatabasePack.BankDatabase bankDatabase = getBankDatabase();
        Screen screen = getScreen();

        screen.sendDataToClient("You can query.");
        String result = bankDatabase.Balancing_query(getCardID());
        System.out.println("Transaction::BalanceInquiry result: " + result
                + "\n");
        screen.sendDataToClient(result);
    }

}
